import { fetchData,postData,delData } from '../../api/index';
import { onMounted,reactive } from 'vue';

export default function(){
    let proj_url = "/api/project"
    let sam_url = "/api/sample"
    let getSampleProject= async () => {
        try {
            const res = await fetchData(sam_url);
            return res
        } catch (error) {
        }
    }
    let queryProject = async <T>(query:T) => {
        try{
            const res = await postData(proj_url,query);
            return res
        } catch (error) {

        }
    }
    let delProject = (id:number) => {
        try{
            let proj_del_url = proj_url;
            delData(proj_del_url + '/' + id);
        } catch (error) {

        }
    }
 
    return { getSampleProject,queryProject,delProject }
}